//
//  viewwwwwww.m
//  32020
//
//  Created by student on 16/4/6.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "viewwwwwww.h"

@implementation viewwwwwww
-(void)setProgress:(float)progress
{
    _progress=progress;
    [self setNeedsDisplay];
}
-(void)drawRect:(CGRect)rect
{
    CGPoint center=CGPointMake(rect.size.width/2, rect.size.height/2);
    CGFloat radius=rect.size.width/2;
    CGFloat startangle=-M_PI_2;
    CGFloat endangel=-M_PI_2+self.progress*M_PI*2;
    UIBezierPath *path=[UIBezierPath bezierPath];
    [path moveToPoint:center];
    [path addArcWithCenter:center radius:radius startAngle:startangle endAngle:endangel clockwise:YES];
    [path closePath];
    [[UIColor greenColor] set];
    [path fill];
    
}

@end
